package com.example.myapp.ADO;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class SQLitedb extends SQLiteOpenHelper {

    final static String name = "msg.db";
    public SQLitedb(@Nullable Context context, int version) {
        super(context, name, null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        //登录用户表
        String sql = "create table msgs (_id integer primary key autoincrement,keys varchar, msgcount int)";
        db.execSQL(sql);
        //登录用户表
        String sql2 = "insert into msgs(keys,msgcount) values('ok',0)";
        db.execSQL(sql2);


    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
